//
//  MyCharteredBusViewController.m
//  didacar
//
//  Created by Yang Yuexia on 15/11/30.
//  Copyright © 2015年 dzmmac. All rights reserved.
//

#import "MyCharteredBusViewController.h"
#import "MyCharteredBusCell.h"
#import "EditCharteredOrderViewController.h"

@interface MyCharteredBusViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (strong, nonatomic) NSMutableArray *dataSource;

@property (weak, nonatomic) IBOutlet UITableView *tableView;

// 包车按钮
@property (weak, nonatomic) IBOutlet UIButton *charteredBusButton;

- (IBAction)charteredBusAction:(id)sender;

@end

@implementation MyCharteredBusViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title = @"嗒嗒包车";
    self.dataSource = [NSMutableArray array];
    self.tableView.tableFooterView = [[UIView alloc] init];
    
    self.charteredBusButton.layer.cornerRadius = 4.0;
    self.charteredBusButton.layer.masksToBounds = YES;
    [self setLeftBtnItem];
}

#pragma mark ---- 列表代理 ----
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 10;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 130;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 10;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    UIView *vi = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, 10)];
    vi.backgroundColor = [UIColor clearColor];
    return vi;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    MyCharteredBusCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyCharteredBusCell"];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
}

#pragma mark ---- 我要包车 ----

- (IBAction)charteredBusAction:(id)sender
{
    EditCharteredOrderViewController *vc = [[UIStoryboard storyboardWithName:@"MyCharteredBus" bundle:nil] instantiateViewControllerWithIdentifier:@"EditCharteredOrderViewController"];
    vc.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:vc animated:YES];
}
@end
